/*------------------------------------------------------------------------------------------------------------------*/
// Initialize Vector Arrays
/*------------------------------------------------------------------------------------------------------------------*/
class Vector3f {

	float x = 0;

	float y = 0;

	float z = 0;

        float w = 0;

  	public void set(float theX, float theY, float theZ, float theW) {
		x = theX;
		y = theY;
		z = theZ;
                w = theW;
	}

	public void set(Vector3f theVector) {
		x = theVector.x;
		y = theVector.y;
		z = theVector.z;
                w = theVector.w;
	}

	public void add(Vector3f theVector) {
		x += theVector.x;
		y += theVector.y;
		z += theVector.z;
                w += theVector.w;
	}

	public void sub(Vector3f theVector) {
		x -= theVector.x;
		y -= theVector.y;
		z -= theVector.z;
		w -= theVector.w;
	}

	public void multiply(float s) {
		x *= s;
		y *= s;
		z *= s;
  	        w *= s;
	}

	public float length() {
		float myLengthSquard = x * x + y * y + z * z + w * w;
		float myLength = (float)Math.sqrt(myLengthSquard);
		return myLength;
	}

	public void normalize() {
		float d = length();
		x /= d;
		y /= d;
		z /= d;
                w /= d;
	}

	public void print() {
		System.out.println("(" + x + ", " + y + ", " + z + w + ")");
	}
//
}
